package com.yc.cinema.service.impl;

import java.util.List;

import org.w3c.dom.TypeInfo;

import com.yc.cinema.bean.FilmType;
import com.yc.cinema.dao.IBaseDao;
import com.yc.cinema.dao.impl.BaseDaoImpl;
import com.yc.cinema.service.IFilmTypeService;

public class FilmTypeServiceImpl implements IFilmTypeService{

	@Override
	public int update(String type) {
		if(type == null || "".equals(type)) {
			return -1;
		}
		IBaseDao baseDao = new BaseDaoImpl();
		return baseDao.update("FilmTypeMapper.add", type);
	}

	@Override
	public List<TypeInfo> findAll() {
		IBaseDao baseDao = new BaseDaoImpl();
		return baseDao.list("FilmTypeMapper.findAll");
	}

	@Override
	public FilmType findByTname(String tname) {
		if(tname == null || "".equals(tname)) {
			return null;
		}
		IBaseDao baseDao = new BaseDaoImpl();
		return baseDao.find("FilmTypeMapper.findByTname", tname);
	}
	
}
